From: Alexander Larsson Date: Thu, 3 Mar 2011 15:29:05 +0000 (+0100) Subject: Bail early from check over all permutations X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8729 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=16a675b7ce681b58c6dfacd8c0e41720d4ab601b;p=gnome-shell.git Bail early from check over all permutations If we're already doing worse than the best so far there is no need to continue checking this particular permutation. https://bugzilla.gnome.org/show_bug.cgi?id=609258 --- diff --git a/js/ui/workspace.js b/js/ui/workspace.js index a2c7172a4..9a80f8c8e 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -735,6 +735,12 @@ Workspace.prototype = { let delta = this._computeWindowMotion(cloneActor, slot); motion += delta; + + // Bail out early if we're already larger than the + // previous best + if (minimumMotionPermutation != null && + motion > minimumMotion) + continue; } if (minimumMotionPermutation == null || motion < minimumMotion) {